#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    initCamera();
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::initCamera()
{
    QCameraInfo cameraInfo = QCameraInfo::defaultCamera();  //获取默认摄像头
    ui->cBoxCamera->addItem(cameraInfo.description());
    ui->cBoxCamera->setCurrentIndex(0);
}

